using System;
using System.Net;
using System.Collections.Generic;
using System.Text;

namespace com.flajaxian.AWS
{
    /// <summary>
    /// Arguments for the ResponseReceived event of the AmazonUploader adapter
    /// </summary>
    public class ResponseReceivedEventArgs : EventArgs
    {
        private HttpWebResponse _response;
        private bool _isSuccessful;
        private string _status;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="response"></param>
        public ResponseReceivedEventArgs(HttpWebResponse response)
        {
            this._response = response;
            this._status = response.StatusDescription;
            this._isSuccessful = (response.StatusDescription.ToLower() == "ok");
        }
        /// <summary>
        /// HttpWebResponse object
        /// </summary>
        public HttpWebResponse Response
        {
            get { return this._response; }
        }
        /// <summary>
        /// String with the status of the web response
        /// </summary>
        public string Status
        {
            get { return this._status; }
        }
        /// <summary>
        /// Boolean indicating if the response was successful
        /// </summary>
        public bool IsSuccessful
        {
            get { return this._isSuccessful; }
        }
    }
}
